#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void DF(int*arr, int* p1, int* p2, int sz)
{
	int str = 0;
	int n = 0;
	for (int i = 0; i < sz; i++)
	{
		str ^= arr[i];
	}
	for (int i = 0; i < 32; i++)
	{
		if (((str >> i) & 1) == 1)
		{
			n = i;
			break;
		}
	}

	for (int i = 0; i < sz; i++)
	{
		if (((arr[i] >> n) & 1) == 1)
		{
			*p1 ^= arr[i];
		}
	}

	*p2 = str ^*p1;

}


int main()
{
	int arr[] = {1,2,3,4,5,1,2,3,4,6 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	int dog1 = 0;
	int dog2 = 0;
	DF(arr, &dog1, &dog2,sz);
	printf("dog1=%d dog2=%d", dog1, dog2);
	return 0;
}